package cc.vicp.djx314.msing.domain.config;

import java.io.Serializable;
import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 加载音乐路径等配置文件
 * @author 水山清风
 *
 */
public class MsingProperties implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 6053877488128785610L;

	public static final Logger logger = LoggerFactory.getLogger(MsingProperties.class);

	public MsingProperties() {
	}

	public static final String MUSIC_ROOT_PATH_KEY = "musicRootPath";
	public static final String IMAGE_ROOT_PATH_KEY = "imageRootPath";
	public static final String DB_URL_KEY = "dbUrl";
	public static final String DB_USER_NAME_KEY = "dbUserName";
	public static final String DB_PASSWORD_KEY = "dbPassword";
	public static final String DB_DRIVER_CLASSNAME_KEY = "dbDriverClassName";

	public MsingProperties(Properties msingProperties) {
		this.musicRootPath = (String) msingProperties.get(MUSIC_ROOT_PATH_KEY);
		logger.info("初始化属性，键：\t{}\t,值：\t{}", MUSIC_ROOT_PATH_KEY, this.musicRootPath);

		this.imageRootPath = (String) msingProperties.get(IMAGE_ROOT_PATH_KEY);
		logger.info("初始化属性，键：\t{}\t,值：\t{}", IMAGE_ROOT_PATH_KEY, this.imageRootPath);

		this.dbUrl = (String) msingProperties.get(DB_URL_KEY);
		logger.info("初始化属性，键：\t{}\t,值：\t{}", DB_URL_KEY, this.dbUrl);

		this.dbUserName = (String) msingProperties.get(DB_USER_NAME_KEY);
		logger.info("初始化属性，键：\t{}\t,值：\t{}", DB_USER_NAME_KEY, this.dbUserName);

		this.dbPassword = (String) msingProperties.get(DB_PASSWORD_KEY);
		logger.info("初始化属性，键：\t{}\t,值：\t{}", DB_PASSWORD_KEY, this.dbPassword);

		this.dbDriverClassName = (String) msingProperties.get(DB_DRIVER_CLASSNAME_KEY);
		logger.info("初始化属性，键：\t{}\t,值：\t{}", DB_DRIVER_CLASSNAME_KEY, this.dbDriverClassName);
	}


	private String musicRootPath;
	private String imageRootPath;

	private String dbUrl;
	private String dbUserName;
	private String dbPassword;
	private String dbDriverClassName;

	public String getMusicRootPath() {
		return musicRootPath;
	}
	public void setMusicRootPath(String musicRootPath) {
		this.musicRootPath = musicRootPath;
	}
	public String getImageRootPath() {
		return imageRootPath;
	}
	public void setImageRootPath(String imageRootPath) {
		this.imageRootPath = imageRootPath;
	}
	public String getDbUrl() {
		return dbUrl;
	}
	public void setDbUrl(String dbUrl) {
		this.dbUrl = dbUrl;
	}
	public String getDbUserName() {
		return dbUserName;
	}
	public void setDbUserName(String dbUserName) {
		this.dbUserName = dbUserName;
	}
	public String getDbPassword() {
		return dbPassword;
	}
	public void setDbPassword(String dbPassword) {
		this.dbPassword = dbPassword;
	}
	public String getDbDriverClassName() {
		return dbDriverClassName;
	}
	public void setDbDriverClassName(String dbDriverClassName) {
		this.dbDriverClassName = dbDriverClassName;
	}
}